.choose(@type, @style) when (@type=xs) {
  @media screen and (max-width: 767.999999px) {
    @style();
  }
}

.choose(@type, @style) when (@type=sm) {
  @media screen and (min-width: 768px) and (max-width: 991.99999px) {
    @style();
  }
}

.choose(@type, @style) when (@type=md) {
  @media screen and (min-width: 992px) and (max-width: 1199.99999px) {
    @style();
  }
}

.choose(@type, @style) when (@type=lg) {
  @media (min-width: 1200px) {
    @style();
  }
}
.choose(@type, @style) when(@type=phone) {
    @media screen and (orientation:portrait) {
        @style();
    }
}
.choose(@type, @style) when(@type=pc) {
    @media screen and (orientation:landscape) {
        @style();
    }
}

.loop(@i,@style,@list) when (@i<length(@list)) {
  .choose(extract(@list,@i+1), @style);
  .loop(@i+1, @style, @list);
}

.media(@style,...) {
  .loop(0, @style, @arguments);
}